function [channel_features, total_features] = EEG_time_feature_extraction(random_samples)
    % 样本数
    num_samples = height(random_samples);
    % 初始化结果矩阵
    channel_features = cell(num_samples, 1);
    total_features = cell(num_samples, 1);
    
    % 对每个元素进行操作 
    parfor i = 1:num_samples
        % 获取当前行的数据
        current_row_data = random_samples{i};
    
        %% 只取前18条数据
        current_row_data = current_row_data(1:18,:);
        
        % 计算平均值
        channel_averages = mean(current_row_data, 2);
    
        % 计算最大值
        channel_max = max(current_row_data, [], 2);
    
        % 计算最小值
        channel_min = min(current_row_data, [], 2);
    
        % 计算标准差
        channel_standard_deviation = std(current_row_data, [], 2);
    
        % 计算偏度
        channel_skewness = skewness(current_row_data, [], 2);
    
        % 计算峰度
        channel_kurtosis = kurtosis(current_row_data, [], 2);
    
        % 计算线段长度
        N = size(current_row_data, 2);
        % 初始化结果矩阵
        channel_line_length = zeros(size(current_row_data, 1), 1, 'single');
        % 计算每个数据段的线段长度并汇总
        for ii = 1:size(current_row_data, 1)
            line_lengths = 1 / (N - 1) * sum(abs(diff(squeeze(current_row_data(ii, :)))), 'all');
            channel_line_length(ii) = line_lengths;
        end
    
        % 计算中位数
        channel_median = median(current_row_data, 2);
        
        % 计算第一四分位数
        channel_quartile1 = prctile(current_row_data, 25, 2);
        
        % 计算第三四分位数
        channel_quartile2 = prctile(current_row_data, 75, 2);
        % 计算通道间皮尔森矩阵
        A_pcc = corrcoef(current_row_data');
        % 将下三角数据展开成向量
        A_pcc_vector = A_pcc(tril(true(size(A_pcc)), -1))';
        % 计算相关矩阵的特征值
        pcc_eigenvalues = eig(A_pcc);


        % 计算通道间互信息矩阵
        mi_data=current_row_data';
        num_variables = size(mi_data, 2);
        wind_size =size(mi_data, 1);
        mutual_info_matrix = zeros(num_variables,'single');
        
        for ii = 1:num_variables
            u1 = mi_data(:, ii);
            %u2_batch = mi_data(:, ii:end); % 仅计算上三角矩阵的元素，因为互信息矩阵是对称的
            
            % 计算每一列变量与当前变量的互信息
            mutual_info_batch = arrayfun(@(col) EEG_calc_mi(u1, mi_data(:, col), wind_size), ii:size(mi_data, 2));
            
            % 将互信息值填充到互信息矩阵中
            mutual_info_matrix(ii, ii:end) = mutual_info_batch;
        end
        % 因为互信息矩阵是对称的，所以复制上三角矩阵到下三角
        mutual_info_matrix = mutual_info_matrix + mutual_info_matrix' - eye(num_variables) .* mutual_info_matrix;
        % 将下三角数据展开成向量
        mi_vector = mutual_info_matrix(tril(true(size(mutual_info_matrix)), -1))';
        mi_eigenvalues= eig(mutual_info_matrix);

        % 将每个通道的特征存储到结果 cell 中
        channel_features{i} = {channel_averages, channel_max, channel_min, channel_standard_deviation, channel_skewness, channel_kurtosis, channel_line_length, channel_median, channel_quartile1, channel_quartile2, pcc_eigenvalues,mi_eigenvalues};
        %channel_features{i} = {channel_averages, channel_max, channel_min, channel_standard_deviation, channel_skewness, channel_kurtosis, channel_line_length, channel_median, channel_quartile1, channel_quartile2};
        % 将总特征存储到结果 cell 中
        total_features{i} = {A_pcc_vector,mi_vector};
    end
end
